import http from '../util/request.js'
export default {
  add:(obj)=> {
    return http({
      url:'/api/category',
      method:'post',
      data:obj,
        headers: {
            'Content-Type': 'application/json'
        }
    })
  },
  all:(obj)=> {
    return http({
      url:'/api/category/list',
      method:'get',
      params:obj
    })
  },
  del: (id) => {
    return http({
      url:'/api/category/'+id,
      method:'delete'
    })
  },
    page:(params)=>{
        return http({
            url: '/api/category/page', // ✅ 正确：/api/brand/page
            method: 'get',
            //表单参数
            params: params,
        });
    },
    edit:(obj)=> {
    return http({
      url:'/api/category',
      method:'put',
      data:obj,
        headers: {
            'Content-Type': 'application/json'
        }
    })
  }
}
